package verify

import (
	"awesomeProject/app/request"
	"errors"
)

func CompanyPagination(r *request.CompanyPagination) error {
	if r.PageIndex == 0 {
		r.PageIndex = 1
	}
	if r.PageSize == 0 {
		r.PageSize = 20
	}
	//
	return nil
}

func CompanyCreate(r *request.CompanyCreate) error {
	if r.CompanyName == "" {
		return errors.New("公司名称不能为空！")
	}
	return nil
}

func CompanyUpdate(r *request.CompanyUpdate) error {
	if r.CompanyName == "" {
		return errors.New("公司名称不能为空！")
	}

	return nil
}
